call

suspend fun call(payload: String): String

Runs the job with payload and suspends until the worker replies.

Calls on one worker instance are serialized, so this is safe to call concurrently. A late reply to a cancelled call is discarded, so this is safe to cancel.

Throws

if the job throws, the worker script failed to load, or close is called while this call is in flight.

if the worker is already closed.